home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / Acere (PowerPlant, Game) 1.2 / AcereÄ.sit / Acereƒ / Code / CardWell.h < prev    next >
Text File  |  1995-02-15  |  3KB  |  100 lines

  1. // ===========================================================================
  2. //    LPane.h                            ⌐1993 Metrowerks Inc. All rights reserved.
  3. // ===========================================================================
  4.  
  5. #pragma once
  6.  
  7. #include <LAttachable.h>
  8. #include <Balloons.h>
  9.  
  10. #ifndef __EVENTS__
  11. #include <Events.h>
  12. #endif
  13.  
  14. #include <LView.h>
  15. class    LStream;
  16.  
  17. #ifndef __DRAG__
  18. #include <Drag.h>
  19. #endif
  20.  
  21. #include "CardDeck.h"
  22. #include <LCommander.h>
  23. #include <LDragAndDrop.h>
  24.  
  25. #if defined(powerc) || defined(__powerc)
  26. #pragma options align=reset
  27. #endif
  28.  
  29. const short kNoCard = -1;
  30. const Int32 cCardWellType = 'Card';    // Usable as a FlavorType or an OSType
  31.  
  32. class CardWell :  public LPane/*, public LCommander, public LDragAndDrop */
  33. {
  34.  
  35. public:
  36. //    CardStruct        itsCard;
  37.     PlayingCard        *itsCard;
  38.     Boolean            cardCanMove, isHighlighted;
  39.     RgnHandle        itsCardRgn;
  40.     
  41.     HMMessageRecord    theWellHelp;
  42.     Rect            itsHelpRect;
  43.     
  44.     
  45.     static CardWell*    CreateCardWell(LStream *inStream);
  46.     
  47.                     CardWell();
  48.                     CardWell(const CardWell    &inOriginal);        
  49.                     CardWell(const SPaneInfo &inPaneInfo);
  50.                     CardWell(LStream *inStream);
  51.                     
  52. //    virtual void    InitPane(const SPaneInfo    &inPaneInfo);
  53.     virtual void    InitCard(void);
  54.     
  55.     virtual            ~CardWell();
  56.  
  57.         // Ñ Drawing
  58.     
  59.     virtual void    Draw(RgnHandle inSuperDrawRgnH);
  60.     virtual void    DrawSelf();
  61.     
  62.     virtual RgnHandle    GetCardRegion(void);
  63.  
  64.     
  65.     virtual Boolean    CanRemove(void);
  66.  
  67.     virtual Boolean    PointInDropArea(Point inGlobalPt);
  68.     
  69.     virtual Boolean    ItemIsAcceptable(DragReference inDragRef, ItemReference    inItemRef);
  70.     
  71. /*    virtual    void    EnterDropArea(DragReference inDragRef, Boolean inDragHasLeftSender);
  72.     virtual    void    LeaveDropArea (DragReference inDragRef);
  73.     virtual    void    InsideDropArea (DragReference inDragRef);
  74.     virtual    void    ReceiveDragItem(DragReference    inDragRef,
  75.                             DragAttributes    inDragAttrs,
  76.                             ItemReference    inItemRef,
  77.                             Rect            &inItemBounds);    // In Local coordinates
  78.     virtual    Boolean    CheckForOptionKey(DragReference inDragRef);
  79.     virtual    Boolean    CheckIfViewIsAlsoSender(DragReference inDragRef);
  80. */    
  81.     
  82.     
  83.     virtual    Boolean    CanDrop(PlayingCard *draggedCard);
  84.     virtual    Boolean    CanDropOnEmptySlot(PlayingCard *draggedCard);
  85.     virtual    Boolean    CanDropOnSlot(PlayingCard *draggedCard);
  86.     
  87.     virtual    void    AddCardToWell(CardWell *whichWell, PlayingCard *whichCard);
  88.     virtual void    RemoveCardFromWell(CardWell *whichWell, PlayingCard *whichCard);
  89.     
  90. //    virtual void    ClickSelf(const SMouseDownEvent &inMouseDown);
  91.     virtual    void    Click(SMouseDownEvent &inMouseDown);
  92. //    virtual    void     FillDataStruct(CardStruct *theStruct);
  93.  
  94. private:
  95.             void    CreateDragEvent        (const SMouseDownEvent &inMouseDown);
  96. };
  97.  
  98. void    CopyPString(ConstStr255Param srcString, Str255 destString);
  99.  
  100.